#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#define SIZE 1024
#define FLUSH_NOW 1
#define FLUSH_LINE 2
#define FLUSH_FULL 4

typedef struct myFILE
{
    int _fileno;
    int _flags;
    char _buff[SIZE];
    int pos;//下次写入的位置
    int _flushtype;

} myFILE;
myFILE *MyFopen(const char *fileName, const char *mode);
void  MyFclose(myFILE *fp);
void MyFflush(myFILE * fp);
size_t MyFwrite(void* ptr[],size_t size, size_t nmemb, myFILE *fp);
